package vn.bang.xiangqi.infrastructure;

public class Vector
{
	private int column;
    private int row;
	
    public Vector()
    {
        column = 0;
        row = 0;
    }

    public Vector(int column, int row)
    {
        this.column = column;
        this.row = row;
    }
    
    public Vector(Position fromPosition, Position toPosition)
    {
        column = toPosition.getColumnIndex() - fromPosition.getColumnIndex();
        row = toPosition.getRowIndex() - fromPosition.getRowIndex();
    }

    public Vector Negative()
    {
        Vector negativeVector = new Vector();
        negativeVector.setColumn(-column);
        negativeVector.setRow(-row);

        return negativeVector;
    }

	public int getColumn() {
		return column;
	}

	public void setColumn(int column) {
		this.column = column;
	}

	public int getRow() {
		return row;
	}

	public void setRow(int row) {
		this.row = row;
	}

}